package com.woyowodaows.viewholder;

import android.content.Context;
import android.graphics.Color;
import android.support.design.widget.TabLayout;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.ViewFlipper;

import com.bumptech.glide.Glide;
import com.paradoxie.autoscrolltextview.VerticalTextview;
import com.woyowodaows.R;
import com.youth.banner.Banner;
import com.youth.banner.BannerConfig;
import com.youth.banner.Transformer;
import com.youth.banner.loader.ImageLoader;


import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 设置首页viewhoder
 */

public class HomePageViewHolder {

    @BindView(R.id.ba_banner)
    public Banner baBanner;
    @BindView(R.id.tv_ad)
    public VerticalTextview tvAd;
    @BindView(R.id.tv_news)
    public TextView tvNews;
//    @BindView(R.id.filpper)
//    public MyViewFlipper vpNews;




    private Context mContext;


    public HomePageViewHolder(Context mContext, View headView) {
        this.mContext = mContext;
        ButterKnife.bind(this, headView);
        initHeadView();
    }

    private void initHeadView() {


        //设置banner样式
        baBanner.setBannerStyle(BannerConfig.CIRCLE_INDICATOR);
        //设置图片加载器
        baBanner.setImageLoader(new ImageLoader() {
            @Override
            public void displayImage(Context context, Object path, ImageView imageView) {
                Glide.with(context).load(path).into(imageView);
            }
        });

        //设置banner动画效果
        baBanner.setBannerAnimation(Transformer.Default);
        //设置自动轮播，默认为true
        baBanner.isAutoPlay(true);
        //设置轮播时间
        baBanner.setDelayTime(3000);
        //设置指示器位置（当banner模式中有指示器时）
        baBanner.setIndicatorGravity(BannerConfig.CENTER);
    }




}
